package com.stillcoolme.basic;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stillcoolme.basic.bean.LittlePerson;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


public class Test2 {
    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("test", "test");
        jsonObject.put("name", "bobo");
        LittlePerson javaObject = jsonObject.toJavaObject(LittlePerson.class);
        System.out.println(javaObject);

        LittlePerson javaObject2 = JSON.parseObject(jsonObject.toJSONString(), LittlePerson.class);
        System.out.println(javaObject2);
    }
}



